home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
StepAndRepeat.pdrx
< prev
next >
Wrap
Text File
|
1992-06-22
|
3KB
|
102 lines
/*
@N
This Genie will make multiple copies of a selection of objects with user specified offset and rotation between copies.
*/
cr = '0a'x
msg = PDSetup.rexx(2,0)
units = getclip(pds_units)
if msg ~= 1 then exit_msg(msg)
signal on halt
signal on break_c
signal on break_e
signal on break_d
form = "Columns"cr"Rows"cr"Gutter"
/* This Genie allows user to duplicate, move and rotate an obj
* in one step
*/
obj = pdm_SelFirstObj()
if obj = 0 then
do
obj = pdm_ClickOnObj("Click on obj to duplicate..")
if obj = 0 then exit_msg()
pdm_SelectObj(obj)
end
dup = 0
objpos = pdm_GetObjVisPosn()
cur_x = word(objpos, 1 )
cur_y = word(objpos, 2 )
objsize = pdm_GetObjVisSize()
width = word(objsize, 1 )
height = word(objsize, 2 )
if units = 3 then
do
call pdm_ShowStatus("Position: " || pdm_ConvertUnits(1, 3, cur_x) || ", " || pdm_ConvertUnits(1, 3, cur_y) || " size: w" || pdm_ConvertUnits(1, 3, width) || ", h" || pdm_ConvertUnits(1, 3, height))
form = "Count:1"cr"Horizontal offset:" || pdm_ConvertUnits(1, 3, width)||cr"Vertical offset:" || pdm_ConvertUnits(1, 3, height)||cr"Horizontal Scaling"cr"Vertical Scaling"cr"Angle"
end
else
do
call pdm_ShowStatus("Position: "cur_x", "cur_y" size: w"width", h"height)
form ="Count:1"cr"Horizontal offset:"width||cr"Vertical offset:"height||cr"Horizontal Scaling"cr"Vertical Scaling"cr"Angle"
end
form = pdm_GetForm("Step & Repeat", 8, form)
if form = '' then exit_msg()
parse var form count '0a'x horizontal '0a'x vertical '0a'x hscale '0a'x vscale '0a'x angle
if count = '' then count = 1
if horizontal = '' then horizontal = 0
if vertical = '' then vertical = 0
if hscale = '' then hscale = 1
if vscale = '' then vscale = 1
if angle = '' then angle = 0
if ~(datatype(count, n) & datatype(horizontal, n) & datatype(vertical, n) & datatype(angle, n) & datatype(hscale,n) & datatype(vscale, n)) then exit_msg("Invalid Entry")
if units = 3 then
do
horizontal = pdm_ConvertUnits(3, 1, horizontal)
vertical = pdm_ConvertUnits(3, 1, vertical)
end
call pdm_AutoUpdate(0)
rotationangle = angle
do i = 1 to count
objpos = pdm_GetObjVisPosn(obj)
objlft = word(objpos, 1)
objtop = word(objpos, 2)
newobj = pdm_CloneObj(,objlft,objtop,horizontal, vertical,hscale,vscale,rotationangle)
obj = newobj
end
exit_msg()
break_d:
break_e:
break_c:
halt:
call exit_msg("User aborted Genie!")
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then call pdm_Inform(1, message,)
call pdm_ClearStatus()
call pdm_SetUnits(units)
call pdm_AutoUpdate(1)
exit
end